﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:odc="clr-namespace:Odyssey.Controls"
    xmlns:mwt="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"                    
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ControlTemplate x:Key="RibbonGroupDropDownButtonTemplate" TargetType="{x:Type odc:RibbonDropDownButton}">
        <Grid>
            <odc:RibbonChrome  x:Name="chrome3"   Focusable="False"
                          BorderBrush="{TemplateBinding BorderBrush}"
                            RenderPressed="{Binding IsDropDownPressed, ElementName=PART_Button}"
                            RenderMouseOver="{TemplateBinding IsMouseOver}"
                            Style="{DynamicResource {ComponentResourceKey odc:Skins, CollapsedRibbonGroupChromeStyle}}">
                <ContentPresenter  Content="{TemplateBinding Content}" VerticalAlignment="Top" HorizontalAlignment="Center"  TextBlock.TextAlignment="Center" Margin="4"/>
            </odc:RibbonChrome>
            <Popup IsOpen="{Binding IsDropDownPressed, RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" 
                               Placement="Bottom"  StaysOpen="False"  
                                MaxHeight="{TemplateBinding MaxDropDownHeight}"
                               PopupAnimation="{TemplateBinding PopupAnimation}"
                               PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                               AllowsTransparency="True" 
                               Name="PART_Popup" 
                               Focusable="False">
                <mwt:SystemDropShadowChrome Margin="0,0,5,5"  Color="#71000000" Name="Shdw" 
                                                        CornerRadius="3"
                                                        MinWidth="{TemplateBinding FrameworkElement.ActualWidth}"  >
                    <ContentControl DockPanel.Dock="Bottom" Content="{TemplateBinding DropDownHeader}" ContentTemplate="{TemplateBinding DropDownHeaderTemplate}"/>
                </mwt:SystemDropShadowChrome>
            </Popup>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="RenderPressed" Value="True" TargetName="chrome3"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
</ResourceDictionary>